<template>
  <div class="content-m">
    <el-row>
      <el-col :span="16">
        <VideoPlayer ref="videoPlayerRef" :video-src="videoInfo.videoUrl" :poster="videoInfo.cover"></VideoPlayer>
<!--        基本信息-->
<!--        评论区-->
      </el-col>
      <el-col :span="8">
        <el-card v-if="videoInfo.setSections.length>0">
          <div slot="header">
            <span>视频合集</span>
          </div>
          <div>
            <div v-for="item in videoInfo.setSections">
              <el-link>{{item.title}}</el-link>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup lang="ts">
import VideoPlayer from '@/components/media/VideoPlayer.vue'
import {ref, reactive, onMounted} from "vue";
import {useRoute} from "vue-router";
import {reqGetVideoInfo} from "@/api/share";

//通用
const route = useRoute()
const videoId=ref(route.params.videoId)
//视频相关
let videoInfo = ref({})

let getVideoInfo = async () => {
  let res = await reqGetVideoInfo(videoId.value)
  videoInfo.value = res.data
}
onMounted(()=>{
  getVideoInfo()
})
</script>

<style scoped>

</style>
